<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <title>Document</title>
    <style>
        #box {
            width: 200px;
            height: 200px;
            background-color: rgb(189, 199, 51);
            margin: 20px auto;
        }

        #box2 {
            width: 200px;
            height: 200px;
            background-color: rgb(80, 32, 225);
            margin: 20px auto;
        }
    </style>
</head>
<body>
<div id="app">
    <button @click="isShow = !isShow">
        {{isShow ? '隐藏' : '显示'}}
    </button>
    <div id="box" v-show="isShow">v-show</div>
    <div id="box2" v-if="isShow">v-if</div>
</div>
<script src="./vue.js"></script>
<script>
    const vm = new Vue({
        el: '#app',
        data: {
            isShow: true
        }
    })
</script>
</body>
</html>